package com.hxh.collection;

import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import java.util.Vector;

/**
 * @author 兴趣使然黄小黄
 * @version 1.0
 * @date 2023/9/7 11:03
 * Vector
 */
public class Demo02 {

    public static void main(String[] args) {
        List<String> list = new Vector<>();

        // 创建 30 个线程, 每个线程都进行插入和取值操作
        for (int i = 1; i <= 30; i++) {
            new Thread(() -> {
                list.add(UUID.randomUUID().toString().substring(0, 8));
                System.out.println(list);
            }, String.valueOf(i)).start();
        }
    }
}
